﻿@model IQueryable<MvcApplicationMyTest.Models.Category>

@{
    ViewBag.Title = "Index";
}

<h2>Список категорий</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Заголовок
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id=item.CategoryId }, new {onclick = "return confirm('Are you sure?')"})
        </td>
    </tr>
}

</table>
